package com.flashflexpro.flexdirector.adapter.codec {
import com.flashflexpro.flexdirector.adapter.descriptor.DescPropertyAuto;

import com.flashflexpro.flexdirector.model.CodeStringValue;

import mx.automation.IAutomationObject;

public class CodecScrollDetail extends CodecDefault{


    override public function encode(obj:Object, descProperty:DescPropertyAuto, relativeParent:IAutomationObject ):CodeStringValue{
        var str:String = obj[ "detail" ];
        if( str == null ){
            str = "atBottom";
        }
        var rt:CodeStringValue = new CodeStringValue();
        rt.desc = descProperty.getDto();
        rt.string = str;
        rt.value = str;
        rt.code = "\"" + str + "\"";
        return rt;
    }

    override public function decode(obj:Object, value:Object, descProperty:DescPropertyAuto, relativeParent:IAutomationObject, inString:Boolean = false):void {
        obj[ "detail" ] = value;
    }
}
}